weather: fix UV index display and add WeatherFlow precipitation#4108
Merged
rejas merged 3 commits intoMagicMirrorOrg:developfrom Apr 19, 2026
Merged
weather: fix UV index display and add WeatherFlow precipitation#4108rejas merged 3 commits intoMagicMirrorOrg:developfrom
rejas merged 3 commits intoMagicMirrorOrg:developfrom
Conversation
Replace || with ?? for numeric weather fields so valid zero values are preserved instead of being replaced with null.
Add precip_accum_local_day and precip_probability to current conditions. Use null-safe checks in template so zero values render correctly.
Rename uv_index to uvIndex in weatherapi provider to match the canonical field name used by all other providers. Update all three templates (current, forecast, hourly) to read uvIndex.
4 tasks
rejas
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While looking at the WeatherFlow provider (to evaluate #4107), I noticed a few things that weren't quite right.
UV index was broken for most providers in forecast/hourly views. The templates read
uv_index, but only the WeatherAPI provider actually wrote that key. All other providers (OpenWeatherMap, WeatherFlow, PirateWeather, etc.) useuvIndex- so UV was silently never displayed for them. This went unnoticed becauseshowUVIndexdefaults tofalseand there were no test assertions for it. Standardized everything onuvIndexand added test coverage.WeatherFlow didn't map precipitation for current weather. The API provides
precip_accum_local_dayandprecip_probability, but they weren't passed through. While adding them I also noticed the template used truthiness checks, which hid valid zero values. Fixed both.||vs??in WeatherFlow provider. Several numeric fields used|| null, replacing valid0withnull. Switched to??for correctness.